DEMO: The playNoteSlide Method

The playNoteSlide method, offered as part of the Note Effects extension, provides a convenient way to generate musical note "slides", often referred to by musicians as glissandos. By customizing the rich set of parameters offered by this method, you can instantly and easily achieve a wide variety of complex sound textures and outrageous effects. Many of these effects will be ideal for the sonification of user interface elements, or even as sound effects for Web-based games implemented using DHTML or Flash (for more information on sonifying Flash movies using Beatnik, see the section Using Beatnik and Flash Together).

In this demo you will be able to preview some cool ready-made note slide examples, and then you can go on to tweak the parameters of the playNoteSlide method to achieve your own personalized note slide effects.

Some Tasty Note Slides

In the table below, each row contains a unique note slide effect. For each note slide effect, there is a descriptive name, a speaker icon to trigger the note slide to play, and a source code listing for the playNoteSlide method call that produces the effect.

Go ahead and take some note slides for a test drive. Be warned, though: you may want to step slowly through the note slides so you don't create too much of a note buildup and so that you can hear each individual note slide effect clearly, without too much of the tail of a previous note slide effect drowning things out.

Let the sliding begin...

Formula 1, Descending  myMusicObject.playNoteSlide (1,1,42,90,75,80,-1,2000,-1,4000) 
Trill Strings, Descending  myMusicObject.playNoteSlide (1,1,44,90,75,80,-1,500,-1,2000) 
Trill Strings, Ascending, Low  myMusicObject.playNoteSlide (1,1,44,40,60,80,-1,1500,-1,2000) 
Trill Strings, Ascending, High  myMusicObject.playNoteSlide (1,1,44,60,85,80,-1,1000,-1,2000) 
Cloudscapes, Ascending, Low  myMusicObject.playNoteSlide (1,1,54,40,60,80,-1,1000,-1,2000) 
Apparition, Ascending  myMusicObject.playNoteSlide (1,1,77,70,90,80,-1,2000,-1,2000) 
Apparition, Descending  myMusicObject.playNoteSlide (1,1,77,85,65,80,-1,1500,-1,2000) 
Moon Jelly, Ascending, High  myMusicObject.playNoteSlide (1,1,82,80,100,80,-1,1500,-1,1000) 
50's Sci-Fi, Descending, Slow  myMusicObject.playNoteSlide (1,1,91,90,70,80,-1,1500,-1,4000) 
50's Sci-Fi, Ascending, Slow  myMusicObject.playNoteSlide (1,1,91,40,80,80,-1,2000,-1,5000) 
UFOs, Ascending  myMusicObject.playNoteSlide (1,1,93,50,80,80,-1,700,-1,2000) 
Soprano, Ascending  myMusicObject.playNoteSlide (1,1,94,40,60,80,-1,700,-1,2000) 
Soprano, Ascending, Overlapped  myMusicObject.playNoteSlide (1,1,94,20,50,80,-1,2000,-1,1000) 
Soprano, Ascending, Low  myMusicObject.playNoteSlide (1,1,94,10,30,80,-1,2000,-1,1000) 
Refractions, Ascending, Low  myMusicObject.playNoteSlide (1,1,95,20,50,127,-1,4000,-1,1000) 
Refractions, Ascending, Mid  myMusicObject.playNoteSlide (1,1,95,50,90,80,-1,2000,-1,2000) 
Refractions, Descending, Mid  myMusicObject.playNoteSlide (1,1,95,90,30,80,-1,1300,-1,2000) 
Refractions, Descending, High  myMusicObject.playNoteSlide (1,1,95,100,70,80,-1,1000,-1,1000) 
Fairy Godmother, Descending, High  myMusicObject.playNoteSlide (1,1,108,90,60,60,-1,1000,-1,2000) 
Fairy Godmother, Descending, Low  myMusicObject.playNoteSlide (1,1,108,60,30,80,-1,2000,-1,5000) 
Fairy Godmother, Ascending, Low  myMusicObject.playNoteSlide (1,1,108,30,50,127,-1,2000,-1,1000) 
Fairy Godmother, Ascending, Mid  myMusicObject.playNoteSlide (1,1,108,50,80,80,-1,1500,-1,1000) 
Teletype, Descending, Short  myMusicObject.playNoteSlide (1,1,113,80,50,80,-1,500,-1,1000) 
Teletype, Descending, Long  myMusicObject.playNoteSlide (1,1,113,80,55,80,-1,1500,-1,3000) 
Cosmic Ray, Descending  myMusicObject.playNoteSlide (1,1,125,40,10,127,-1,300,-1,1000) 
Cosmic Ray, Ascending, High  myMusicObject.playNoteSlide (1,1,125,40,70,70,-1,300,-1,1000) 
SampHold, Ascending  myMusicObject.playNoteSlide (1,1,126,20,65,80,-1,2000,-1,2000) 
SampHold 2, Ascending  myMusicObject.playNoteSlide (1,1,127,20,65,80,-1,2000,-1,2000) 
SampHold 2, Descending  myMusicObject.playNoteSlide (1,1,127,60,30,80,-1,1000,-1,1000) 
Noise Echo, Descending  myMusicObject.playNoteSlide (1,1,194,60,30,80,-1,2000,-1,3000) 
UFO-by, Descending  myMusicObject.playNoteSlide (1,1,186,120,20,70,-1,1000,-1,1000,25) 
UFO-by, Ascending  myMusicObject.playNoteSlide (1,1,186,20,120,70,-1,1000,-1,1000,25) 
UFO-by, Ascending, Slow  myMusicObject.playNoteSlide (1,1,186,50,85,60,-1,1000,-1,1500,100) 
Hi Temple Gong, Ascending  myMusicObject.playNoteSlide (1,1,202,50,70,50,-1,1000,-1,500,25) 
SloLaser, Descending  myMusicObject.playNoteSlide (1,1,185,85,50,80,-1,1000,-1,500,50) 
Rvs Cymb Pan Long, Ascending, Slow  myMusicObject.playNoteSlide (1,1,180,1,40,65,-1,1500,-1,3000,25) 
Bucket Hit, Ascending  myMusicObject.playNoteSlide (1,1,197,20,120,127,60,1000,-1,1000,25) 
Growl Organ, Up & Down  myMusicObject.playNoteSlide (1,1,18,40,80,60,110,3000,1000,1000,25) 
Seashore, Rolling  myMusicObject.playNoteSlide (1,0,122,100,20,40,127,5000,1000,2000) 
Tweak It!

Now that you have seen what a couple of note slide effects look like when expressed in the syntax required by the playNoteSlide method, why not experiment with some settings of your own.

The interface below is designed to resemble a call to the playNoteSlide method and lets you edit all of the method's parameters. An entry box is provided for each of the method's parameters, with the exception of the MidiChannel1to16 parameter which has a fixed value of 1 in this interface. To the left of each parameter entry box is the name of the parameter and, wherever reference information is available for a parameter, the parameter name is linked to the reference information.

So, go ahead and tweak the parameters in the interface below. When you have a set of values that you like and you'd like to preview the note slide effect that would result from those settings, just hit the "Preview" button...

playNoteSlide Method Editor
myMusicObject.playNoteSlide ( MidiChannel1to16 
 1
 ,
BankNumber0to2   ,
ProgramNumber0to255   ,
StartNoteNumber0to127   ,
EndNoteNumber0to127   ,
StartVelocity0to127   ,
EndVelocity0to127   ,
StartNoteDurationMsINT   ,
EndNoteDurationMsINT   ,
SlideTimeMsINT   ,
NoteIntervalMsINT   )


You can also "seed" the interface with values by returning to the previous Some Tasty Note Slides section and clicking on any of the buttons to play a note slide. When you scroll back down again to this section, then the parameters in the playNoteSlide Method Editor's interface will be seeded with the values needed to play the note slide you just played. You can then edit the parameters from there to derive new note slides from those listed in the previous section.

Don't be thrown off by the fact that each parameter is on its own new line. This layout was chosen so that it wouldn't be necessary to scroll horizontally all the time to edit different parameters. It is also perfectly acceptable in the JavaScript language to break up a method or function call over several lines, provided that you don't end a line on an unterminated string literal (ie. start a string parameter with an opening quote but don't close the string on the same line). For example, the following method call is perfectly valid in JavaScript...

myMusicObject.playNoteSlide (
   1,
   1,
   197,
   20,
   120,
   127,
   60,
   1000,
   -1,
   1000,
   25
);

Sliding in Stereo

Now, let's take a look at some more intricate techniques using the playNoteSlide method. In all of the examples below, there are two note slide effects being played: one that is panned full left and one that is panned full right. By playing two panned note slides in this way, one can achieve some pretty radical spatialized effects.

In all of the source code listings for the examples, the calls to the playNoteSlide method have been highlighted. The other lines of code preceding the playNoteSlide method calls set up the MIDI channels 1 and 2 so that they are panned full left and full right, respectively, and so that there is no reverb send for the channels. Setting the reverb send level to 0 is important, since reverb would tend to "muddy" the effects and detract from the extreme stereo spatialization that is achieved by the effects.

Fairy Godmothers, Crossing Paths

In this example, the "Fairy Godmother" instrument (bank 1, program 108) is being used for both the left-panned note slide and the right-panned note slide. Both of the note slides play for the same duration, have the same starting and ending note velocities, and the same start and end note durations. In fact, the two note slides are identical but for one small detail: wherease the left-panned note slide starts from note pitch 50 and ascends to note pitch 80, the right-panned note slide starts from note pitch 80 and descends to note pitch 50. So, the note pitches for the two slides are going in the exact opposite directions, and crossing paths somewhere in the middle. This produces a pretty cool stereo pitch effect that resembles a Doppler effect.

/*** set channels' reverb send level to 0 ***/
myMusicObject.setController (1,91,0);
myMusicObject.setController (2,91,0);

/*** pan the channels full left and full right ***/
myMusicObject.setController (1,10,0);
myMusicObject.setController (2,10,127);

/*** play the two note slides ***/
myMusicObject.playNoteSlide (1,1,108,50,80,80,-1,1500,-1,1000);
myMusicObject.playNoteSlide (2,1,108,80,50,80,-1,1500,-1,1000);

50's Sci-Fi, Converging

In this example, the "50's Sci-Fi" instrument (bank 1, program 91) is being used for both the left-panned note slide and the right-panned note slide. Both of the note slides play for the same duration, have the same starting and ending note velocities, the same start and end note durations, and even the same ending note pitch. The only difference is that the two note slides start from different note pitches: wherease the left-panned note slide starts from note pitch 90 and descends to note pitch 70, the right-panned note slide starts from note pitch 50 and ascends to note pitch 70. So, the note pitches for the two slides move from opposite sides to end up in the middle, at note pitch 50. This produces a converging effect.

/*** set channels' reverb send level to 0 ***/
myMusicObject.setController (1,91,0);
myMusicObject.setController (2,91,0);

/*** pan the channels full left and full right ***/
myMusicObject.setController (1,10,0);
myMusicObject.setController (2,10,127);

/*** play the two note slides ***/
myMusicObject.playNoteSlide (1,1,91,90,70,50,100,500,2000,4000);
myMusicObject.playNoteSlide (2,1,91,50,70,50,100,500,2000,4000);

Soundtrack 2, Stereo Sweep of 5ths

In this example, the "Soundtrack 2" instrument (bank 1, program 97) is being used for both the left-panned note slide and the right-panned note slide. Because the duration for each note slide is exactly the same and because no value is specified for the NoteIntervalMsINT parameter for each note slide (so the default value will be used), the notes for both note slides will be exactly synchronized to each other. And because the values for the StartNoteNumber0to127 and EndNoteNumber0to127 parameters for the right-panned note slide are exactly 7 greater than these parameters' values for the left-panned note slide, the two note slides will be perfectly harmonized by a musical 5th in the stereo field.

Finally, to add a stereo panning effect, the right-panned slide starts with a note velocity of 110 and ends with a note velocity of 10, whereas the left-panned note slide starts with a velocity of 10 and ends with a note velocity of 110. To further emphasize this panning effect, the right-panned note slide starts with a note duration of 1000 and ends with a note duration of 500, whereas the left-panned note slide starts with a note duration of 500 and ends with a note duration of 1000. The result of this is that the notes with a higher velocity also have a longer duration, making them appear even stronger.

/*** set channels' reverb send level to 0 ***/
myMusicObject.setController (1,91,0);
myMusicObject.setController (2,91,0);

/*** pan the channels full left and full right ***/
myMusicObject.setController (1,10,0);
myMusicObject.setController (2,10,127);

/*** play the two note slides ***/
myMusicObject.playNoteSlide (1,1,97,80,50,10,110,500,1000,3000);
myMusicObject.playNoteSlide (2,1,97,87,57,110,10,1000,500,3000);

Bucket Hit and Thuddy Kick, Ascending in Parallel

In this example, all aspects of the left-panned and right-panned note slides are exactly the same, except for the instruments used for each. While the left-panned note slide is playing the "Bucket Hit" percussion sound (bank 1, program 197), the right-panned note slide is playing the "Thuddy Kick" percussion sound (bank 1, program 203). So, while the timing, pitch, velocity, and duration of every note is exactly the same for both note slides, the use of different instruments for left and right still creates a unique stereo effect.

/*** set channels' reverb send level to 0 ***/
myMusicObject.setController (1,91,0);
myMusicObject.setController (2,91,0);

/*** pan the channels full left and full right ***/
myMusicObject.setController (1,10,0);
myMusicObject.setController (2,10,127);

/*** play the two note slides ***/
myMusicObject.playNoteSlide (1,1,197,20,120,127,60,1000,-1,1000,25);
myMusicObject.playNoteSlide (2,1,203,20,120,127,60,1000,-1,1000,25);

Widening

In this example, a unique stereo "widening" effect is achieved. As you will notice, the parameter values for the left-panned and right-panned note slides are almost identical. The only subtle difference is in the values set for the SlideTimeMsINT and NoteIntervalMsINT parameters. Even despite these differences, both note slides play exactly the same number of notes: 41. While the left-panned note slide has a time of 1200 milliseconds, the note interval of 30 milliseconds yields exactly 41 notes to be played (as calculated by the expression Math.floor (SlideTimeMsINT / NoteIntervalMsINT) + 1). And while the right-panned note slide has a time of 1000 milliseconds, its note interval of 25 milliseconds also yields exactly 41 notes to be played (as calculated by the expression Math.floor (SlideTimeMsINT / NoteIntervalMsINT) + 1).

So, given that both note slides play exactly the same instrument and exactly the same number of exactly the same notes (same pitch, velocity, and duration), the only difference is in the timing. And because both note slides start out at the same time but have slightly different durations, the notes in each note slide will tend to drift further apart in timing towards the end of the note slides. This produces the stereo widening effect. What starts out sounding like a mono, center-panned note slide effect progressively spreads out to become much more stereo sounding.

/*** set channels' reverb send level to 0 ***/
myMusicObject.setController (1,91,0);
myMusicObject.setController (2,91,0);

/*** pan the channels full left and full right ***/
myMusicObject.setController (1,10,0);
myMusicObject.setController (2,10,127);

/*** play the two note slides ***/
myMusicObject.playNoteSlide (1,0,193,80,40,60,127,1000,-1,1200,30);
myMusicObject.playNoteSlide (2,0,193,80,40,60,127,1000,-1,1000,25);